module.exports = function (grunt) {
    require('load-grunt-tasks')(grunt);
    require('time-grunt')(grunt);
    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),
        meta: {
            basePath: '../',
            srcPath: 'sass/pages/',
            deployPath: '../webapp/style/pages/'
        },
        clean: ['webapp/**'],
        uglify: {
            options: {},
            dist: {
                files: {
                    'webapp/css/scroll.min.js': 'src/css/scroll.js'
                }
            }
        },
        htmlmin: {
            dddd: {
                options: {
                    removeComments: true,
                    collapseWhitespace: true
                },
                files: [{                                   // Dictionary of files
                    'webapp/css/index.html': 'src/css/index.html',     // 'destination': 'source'
                    'webapp/css/333.html': 'src/css/333.html'     // 'destination': 'source'
                }]
            }
        },
        cssmin: {
            aaaa: {//压缩css文件
                files: [{
                    expand: true,
                    cwd: 'src/css',
                    src: ['*.css'],
                    dest: 'webapp/css',
                    ext: '.min.css'
                }]
            }
        },

        copy: {
            main: {
                files: [
                    {expend: true, cwd: 'crm', src: '**', dest: '../webapp', flatten: false, filter: 'isFile'},
                    {expend: true, cwd: 'wx', src: '**', dest: '../webapp', flatten: false, filter: 'isFile'}
                ]
            }
        },
        sass: {
            dist: {
                files: {
                    '<%= meta.deployPath %>style.css': '<%= meta.srcPath %>style.scss'
                },
                options: {
                    sourcemap: 'true'
                }
            }
        }


    });

    grunt.registerTask('default', ['sass']);

}
